import { defineStore, createPinia } from 'pinia'
import piniaPluginPersist from 'pinia-plugin-persist'
import type { App } from 'vue'

const store = createPinia()
store.use(piniaPluginPersist)

export function setupStore(app: App<Element>) {
    app.use(store);
}

export default store
export const useStoriesStore = defineStore({
    persist: {
        enabled: true,
        strategies: [
            {
                storage: localStorage,//表示存储在localStorage
            }
        ]
    },
    id: "index",
    state: () => {
        return {
            vip: false,
        }
    },
})


